//
//  MYShopCarBottonView.swift
//  MuYing
//
//  Created by tbb on 2019/7/30.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYShopCarBottonView: UIView {
    
    @objc var isManageModel = false {
        didSet {
            if isManageModel {
                self.deleteBtn.isHidden = false;
                self.moveBtn.isHidden = false;
                
                self.settlementBtn.isHidden = true;
                self.totalMoneyLb.isHidden = true;
            }else{
                self.settlementBtn.isHidden = false;
                self.totalMoneyLb.isHidden = false;
                self.deleteBtn.isHidden = true;
                self.moveBtn.isHidden = true;
            }
        }
    }

    @IBOutlet weak var selectAllBtn: QMUIButton!
    @IBOutlet weak var deleteBtn: UIButton!
    
    @IBOutlet weak var moveBtn: UIButton!
    
    @IBOutlet weak var settlementBtn: UIButton!
    
    @IBOutlet weak var totalMoneyLb: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib();
        self.selectAllBtn.setImage(UIImage(named: "shopCar_select_d_icon"), for: .normal)
        self.selectAllBtn.setImage(UIImage(named: "shopCar_select_s_icon"), for: .selected)
        
        self.deleteBtn.layer.borderWidth = 1;
        self.deleteBtn.layer.borderColor = UIColorFromHex(rgbValue: 0xF88282).cgColor;//appThemeColor.cgColor;
        self.deleteBtn.layer.cornerRadius = 16;
        
        self.moveBtn.layer.borderWidth = 1;
        self.moveBtn.layer.borderColor = appThemeColor.cgColor;
        self.moveBtn.layer.cornerRadius = 16;
        
        self.settlementBtn.layer.cornerRadius = 16;
        self.settlementBtn.clipsToBounds = true;
        
        self.deleteBtn.isHidden = true;
        self.moveBtn.isHidden = true;
        
        self.selectAllBtn.setTitle(kYQLSSwift("全选"), for: .normal)
        self.deleteBtn.setTitle(kYQLSSwift("删除"), for: .normal)
        self.moveBtn.setTitle(kYQLSSwift("移入收藏夹"), for: .normal)
        self.settlementBtn.setTitle(kYQLSSwift("结算"), for: .normal)
        self.selectAllBtn.imagePosition = .left;
        self.selectAllBtn.spacingBetweenImageAndTitle = 3;
    }

}

